define(["config/appregister", "services/httpServices"],function(app){
	app.controller('homeCtrl', function($scope,httpCtrl){
        $scope.clickUrl = function(url){
            window.location.href = "#/"+url;
        }
        $scope.json = "展示json";
        $scope.login = function(){
            httpCtrl.data("//sso.jd.com/exit?t="+new Date()+"&callback=?");
            httpCtrl.data("//sso.jcloud.com/exit?t="+new Date()+"&callback=?");
            setTimeout(function () {
                window.location.href="https://sso.jcloud.com/sso/login?ReturnUrl="+window.location.protocol+"//"+window.location.host;
            }, 500);
        }

        $scope.isget = function(){
            httpCtrl.data("/login",function(res){
                //console.log(res);//返回操作
                $scope.json = JSON.stringify(res, false, 4);
            });
        }

        $scope.ispost = function(){
            httpCtrl.data("/post",{},function(res){
                //console.log(res);//返回操作
                $scope.json = JSON.stringify(res, false, 4);
            });
        }
	})
})